package org.example.cglib.impl;

import net.sf.cglib.proxy.Enhancer;
import org.example.cglib.CglibProxy;

public class Util {

    public static  <T> T getInstance(Class<T> clzz){
        CglibProxy cglibProxy = new CglibProxy();
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(clzz);
        enhancer.setCallback(cglibProxy);
        return (T) enhancer.create();

    }
}
